﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="connDbBean" scope="page" class="com.util.db"/>
<html>
  <head>
    <title>讨论区</title>
 	<script type="text/javascript" src="ny/js/jquery.min.js"></script>
<script type="text/javascript" src="ny/js/bootstrap.min.js"></script>
<script src="ny/js/jconfirm/jquery-confirm.min.js"></script>
<link href="ny/css/bootstrap.min.css" rel="stylesheet">
<link href="ny/css/materialdesignicons.min.css" rel="stylesheet">
<link href="ny/css/style.min.css" rel="stylesheet">
<link rel="stylesheet" href="ny/js/jconfirm/jquery-confirm.min.css">  
 <link rel="stylesheet" href="kindeditor_a5/themes/default/default.css" />
	<link rel="stylesheet" href="kindeditor_a5/plugins/code/prettify.css" />
	<script charset="utf-8" src="kindeditor_a5/kindeditor.js"></script>
	<script charset="utf-8" src="kindeditor_a5/lang/zh_CN.js"></script>
	<script charset="utf-8" src="kindeditor_a5/plugins/code/prettify.js"></script>
	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="neirong"]', {
				cssPath : 'kindeditor_a5/plugins/code/prettify.css',
				uploadJson : 'kindeditor_a5/jsp/upload_json.jsp',
				fileManagerJson : 'kindeditor_a5/jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
            if (typeof prettyPrint === 'function') {
                // 使用 window.onload 或 DOM ready 确保元素加载完成
                $(document).ready(function () {
                    prettyPrint();
                });
            } else {
                console.error("prettyPrint 函数未定义，请检查 prettify.js 是否加载成功");
            }
            //prettyPrint();
		});
	</script>
	
</head>
<%String id=request.getParameter("id");%>
<body >
<div >
<div class="card-header"><h4>讨论区</h4></div>
<div class="card-body">
 <table   border="1" align="center" cellpadding="3"   bordercolor="#CCCCCC" style="border-collapse:collapse;width:1500px;"    >
                      <tr>
                        <td height="104" valign="top">
						
						
						
					 
                            <table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" style="border-collapse:collapse">
                              <tr>
                                <td height="56" colspan="2" bordercolor="#333333"><div align="center"><span class="STYLE1"><%=connDbBean.readzd("tiezi","biaoti","id",id)%>&nbsp; </div></td>
                              </tr>
                              <tr>
                                <td width="12%" bordercolor="#333333" bgcolor="#F5F5F5"
								
								style="vertical-align: top" > <p style="margin:25px; margin-top:30px;">
								<img src="<%=connDbBean.readzd("tiezi","fujian","id",id)%>" width="80" height="80">  </p>
                                  <p style="margin:25px; line-height:5px;">发起人</p>
                                  <p style="margin:25px;line-height:5px;"><%=connDbBean.readzd("tiezi","faburen","id",id)%><%=connDbBean.readzd("tiezi","issh","id",id)%></p></td>
                               
								
								
								 <td width="88%" height="100"><br><p style="width:20px; float:left;   height:200px;"></p> <%=connDbBean.readzd("tiezi","neirong","id",id)%><br><br> <p style="float:right; margin-top:150px; padding:0 50px 0 0;"> 发布时间：<%=connDbBean.readzd("tiezi","addtime","id",id)%> </p></td>
                              </tr>
							  
							  
                          </table>
                        
                        </td>
                      </tr>
                      <tr>
                        <td align="right"><table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#CCCCCC" style="border-collapse:collapse">
                            <tr>
                              <td colspan="2">已有回复如下：</td>
                            </tr>
							 <%

							int bbsi=0;
							  String sqlbbs =  "select * from tiezi where fid='"+id+"' order by id desc";
//                              connDbBean.nmm = "2005";
							  ResultSet RS_resultbbs=connDbBean.executeQuery(sqlbbs);
								while(RS_resultbbs.next()){
								bbsi++;
								%>
                            <tr>
                              <td width="12%" bgcolor="#F5F5F5" style="vertical-align: top" ><p>&nbsp;</p>
                              <p style="margin:10px 25px 25px 25px;line-height:5px;"><img src="<%=RS_resultbbs.getString("fujian") %>" width="80" height="80"></p>
							  
							 <% if(RS_resultbbs.getString("faburen").equals(connDbBean.readzd("tiezi","faburen","id",id)))
{%>
<p style="margin:25px; line-height:5px;">发起人</p>
 
<%}%>

							   
                              <p style="margin:10px 25px 25px 25px;line-height:5px;"><%=RS_resultbbs.getString("faburen") %><%=RS_resultbbs.getString("issh") %></p>
                             
                           </td>
                              <td width="88%" height="100"><br><p style="width:20px; float:left;   height:200px;"></p><%=RS_resultbbs.getString("neirong") %><br><br> <p style="float:right; margin-top:150px; padding:0 50px 0 0;"> 发布时间：<%=RS_resultbbs.getString("addtime") %></p></td>
                            </tr>
                            <%
						  	}
						  %>
                            <tr>
                              <td colspan="2">发表回复：</td>
                            </tr>
                            <tr>
							  <td height="60" colspan="2" align="left">
							<form action="addTiezi2.do" name="form1" method="post">
                                <textarea name="neirong" cols="100" rows="8" style="width:700px;height:200px;visibility:hidden;"> </textarea>
                                <input type="submit" name="Submit" class="btn btn-primary"  value="回复">
								   
                                   <input name="fujian" type="hidden" id="fujian" value="<%=request.getSession().getAttribute("zhaopian")%>">
								      <input name="issh" type="hidden" id="issh" value="<%=request.getSession().getAttribute("cx")%>">
								  <input name="bankuai" type="hidden" id="bankuai" value="<%=connDbBean.readzd("tiezi","bankuai","id",id)%>"> <input name="faburen" type="hidden" id="faburen" value="<%=request.getSession().getAttribute("username")%>"> <input name="fid" type="hidden" id="fid" value="<%=id%>"> <input name="addtime" type="hidden" id="addtime" value="<%=connDbBean.gettime()%>" />
                              </form>
						 
</div>
</div>
</body>
</html>